package tengxun;

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main3 {

    private static String res;

    public static void main(String[] args) throws Exception{
        BufferedReader buf = new BufferedReader(new InputStreamReader(System.in));
        String s = buf.readLine();
        String[] ss = s.split(" ");
        int n = Integer.parseInt(ss[0]);
        int k = Integer.parseInt(ss[1]);
        StringBuilder trace = new StringBuilder();
        s = buf.readLine();
        traceback(s, 0, k, trace);
        System.out.println(res);
    }
    public static void traceback(String s, int beginIndex, int k, StringBuilder trace){
        if (k == 0){
            res = trace.toString();
        }
        char maxChar = 'A';
        for (int i = beginIndex; i < s.length(); i++){
            if (s.charAt(i) > maxChar){
                maxChar = s.charAt(i);
                trace.append(s.charAt(i));
                traceback(s, i + 1, k - 1, trace);
                trace.deleteCharAt(trace.length() - 1);
            }
        }
    }
}
